#!/bin/bash
#variables
PROJECT_PATH="IOSDemo"
TARGET="IOSDemoMonkey"
SDK="iphonesimulator"
BUILD_PATH="/build/Release-iphonesimulator/IOSDemoMonkey.app"

IDENTITY="iPhone Developer: Dishan Fernando (GU8BCD399N)"
KEYCHAIN="/Users/IOTAdmin/Library/Keychains/login.keychain"
PASSWORD="macmini09"

clear
echo "======================================="
cd $PROJECT_PATH
CURRENT_DIRECTORY="`pwd`"
security list-keychains -s ${KEYCHAIN}
security unlock-keychain -p ${PASSWORD} ${KEYCHAIN}
xcodebuild clean build -target $TARGET -sdk "${SDK}" CODE_SIGN_IDENTITY="${IDENTITY}" OTHER_CODE_SIGN_FLAGS="--keychain ${KEYCHAIN}"
cd ".."
#iphonesim launch-async "${CURRENT_DIRECTORY}"/"${BUILD_PATH}"
#cd ".."
#cd "${MONKEY_TALK_SCRIPT_PATH}"
#ant